package com.czy.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

import java.util.UUID;

/**
 * @author czy
 * @date 2022-1-28 15:35
 */
public class IdUtils {
    public static void main(String[] args) {
        System.out.println(getUuid());
        System.out.println(getSimpleUuid());
    }

    /**
     * 获取uuid
     * 生成的UUID是带-的字符串 类似于: a5459f9e-13c2-4c66-bc8a-9b3fa1483df7
     * @return
     */
    public static String getUuid(){
        return UUID.randomUUID().toString();
    }

    /**
     * 生成的是不带-的字符串，类似于: 9f8b70aa53d0405b9a8f70c6593d3e63
     * @return
     */
    public static String getSimpleUuid(){
        return getUuid().replace("-","");
    }
}
